package com.huhu.SpringDemo;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class DrilService {
	
	@Autowired
	private DrilJPA drilJPA;
	
	@Transactional
	public void addTwo(){
		Dril dril1=new Dril();
		dril1.setId(3);
		dril1.setAge(20);
		dril1.setName("xiaosan");
		drilJPA.save(dril1);
		
		Dril dril2=new Dril();
		dril1.setId(4);
		dril1.setAge(24);
		dril1.setName("xiaosi");
		drilJPA.save(dril2);
	}
	
}
